package com.reportes;

import org.achartengine.chart.PointStyle;
import org.achartengine.model.TimeSeries;
import org.achartengine.model.XYMultipleSeriesDataset;
import org.achartengine.renderer.XYMultipleSeriesRenderer;
import org.achartengine.renderer.XYSeriesRenderer;

import android.graphics.Color;

public class Venta_General 
{
	private XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();
	private XYMultipleSeriesRenderer mRender = new XYMultipleSeriesRenderer();
	
	public XYMultipleSeriesDataset getDataset () {return this.dataset;}
	
	public XYMultipleSeriesRenderer getRenders () {	return this.mRender;}
	
	public void obtenerAnuales ()
	{
		int [] x = {2006,2007,2008,2009,2010,2011,2012};
		int [] y = {20000,30000,10000,50000,40000,45000,20100};
		
		TimeSeries series = new TimeSeries("Ventas Anuales");
		for (int i= 0; i < x.length; i++)
		{
			series.add(x[i],y[i]);
		}
			
		dataset.addSeries(series);
		
		XYSeriesRenderer render = new XYSeriesRenderer();
		render.setDisplayChartValues(true);
		render.setColor(Color.BLACK);
		render.setPointStyle(PointStyle.SQUARE);
		render.setFillPoints(true);
				
		mRender.addSeriesRenderer(render);
		mRender.setChartTitle("Ventas Totales");
	}
	
	public void obtenerTrimestrales ()
	{
		int [] x = {1,2,3,4,5,6};
		int [] y = {21000,12000,23000,56000,23000,78000,12100};
		
		TimeSeries series = new TimeSeries("Ventas Trimestrales");
		for (int i= 0; i < x.length; i++)
		{
			series.add(x[i],y[i]);
		}
			
		dataset.addSeries(series);
		
		XYSeriesRenderer render = new XYSeriesRenderer();
		render.setDisplayChartValues(true);
		render.setColor(Color.BLACK);
		render.setPointStyle(PointStyle.SQUARE);
		render.setFillPoints(true);
				
		mRender.addSeriesRenderer(render);
		mRender.setChartTitle("Ventas Totales");
	}
	
	public void obtenerMensuales ()
	{
		int [] x = {1,2,3,4,5,6};
		int [] y = {54000,21000,26000,21000,14000,68000,90100};
		
		TimeSeries series = new TimeSeries("Ventas Mensuales");
		for (int i= 0; i < x.length; i++)
		{
			series.add(x[i],y[i]);
		}
			
		dataset.addSeries(series);
		
		XYSeriesRenderer render = new XYSeriesRenderer();
		render.setDisplayChartValues(true);
		render.setColor(Color.BLACK);
		render.setPointStyle(PointStyle.SQUARE);
		render.setFillPoints(true);
				
		mRender.addSeriesRenderer(render);
		mRender.setChartTitle("Ventas Totales");
	}

}
